#pragma once
#include <bitset>
#include <map>
//using std::bitset;
using namespace std;

class MarchingCubeTable
{
public:
	MarchingCubeTable(void);
	~MarchingCubeTable(void);
	void initTMap(void);
	void initRotate(void);

public:
	static MarchingCubeTable* getInstance();
	bitset<8>* getTriangles(bitset<8>);
	bitset<8> rot(bitset<8>, int*);
	bitset<8> revert(bitset<8>, int*);

private:
	static MarchingCubeTable* mct;            //MarchingCuble Table point
	map<int, int* > tmap;            //Map used to find triangles
	static int rotate[48][8];								      //Array used to rotate point
	bitset<8> triangles[12];					      //Triangles to return
	static int  mapTable[15][12];
};
